<template>
  <el-dropdown @command="changeVal" class="dropdown-area">
    <span>{{ logicFormat[val] }}<i class="el-icon-arrow-down el-icon--right"></i></span>
    <el-dropdown-menu slot="dropdown">
      <el-dropdown-item command="and">全部</el-dropdown-item>
      <el-dropdown-item command="or">任一</el-dropdown-item>
    </el-dropdown-menu>
  </el-dropdown>
</template>

<script>

export default {
  name: 'ChooseLogic',
  props: {
    val: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      logicFormat: { and: '全部', or: '任一' }
    }
  },
  mounted() {
  },
  methods: {
    changeVal(val) {
      this.$emit('update:val', val)
    }
  }
}
</script>

<style lang="scss" scoped>
.el-icon-arrow-down{
  color: #a3a3a3;
}
</style>
